package com.tingyuge.base.thread.wang.chapter8;

/**
 * Created by xiaodao
 * date: 2019/11/29
 */
public class ThreadException {

    public static void main(String[] args) {

        Thread thread = new Thread(() -> {
            int i = 10 / 0;
            System.out.println(i);
        },"t1");

        thread.setUncaughtExceptionHandler((t,e)->{
            System.out.println(t.getName());
            System.out.println(e.getMessage());
        });
        thread.start();
    }
}
